package edu.maplef.bookwild;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import edu.maplef.bookwild.config.Config;

/**
 * 启动时加载数据
 * @author maple
 * @version 1.0
 */
public class StartupServlet extends HttpServlet {

	private static final long serialVersionUID = -6956695319802675576L;

	String configFile;

	public void init() throws ServletException {
		try {
			configFile = this.getServletConfig().getInitParameter("configFile");
			Config.setPath(configFile);
			Config.init();
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

	public String getConfigFile() {
		return configFile;
	}

	public void setConfigFile(String configFile) {
		this.configFile = configFile;
	}

}
